/**
 * authenyication.js
 * 登录鉴权
 *
 * created by qiuwei
 * version 1.0.0
 * 2016年03月28日
 */


import * as CONSTANTS from '../../constants/API';
import rp from '../requestProxy';

export default function authenticate({ mobile, password, security_code }) {
	let url = `${CONSTANTS.HOST}${CONSTANTS.AUTHENTICATE_URL_ON_SERVER}`;
	// console.log(JSON.stringify({ mobile, password, security_code }));
	return rp.post(url, { mobile, password, security_code })
		.then((result) => {
			// debugger;
			return result;
		});
};

export function modifyPassword({ mobile, password, new_password, security_code }) {
	let url = `${CONSTANTS.HOST}${CONSTANTS.MODIFY_PASSWORD_ON_SERVER}`;
	
	return rp.post(url, { mobile, password, new_password, security_code });
};